from tray import SysTrayIcon
from entrygui import EntryGUI
from scheduler import Scheduler
from multiprocessing import Process, freeze_support

if __name__ == '__main__':
    freeze_support()

    def bye(sysTrayIcon):
        global scheduler
        scheduler.stop()
        
    def newEntry(sysTrayIcon):  
        p = Process(target=EntryGUI)
        p.start()
        
    scheduler = Scheduler();
    menu_options = (('Add a new entry', None, newEntry),)
    
    SysTrayIcon('ttlogger.ico', 'Double click to add a new entry', menu_options, on_quit=bye, default_menu_index=0)
